import classNames from 'classnames';
const Grid = (props = {}) => {
  const {
    children,
    className,
    gap,
    repeat,
    rowGap,
    columGap,
    minWidth,
    maxWidth,
    ...props
  } = props;

  let style = {};
  if (repeat) {
    style['--grid-repeat'] = repeat;
  }
  if (gap) {
    style['--grid-row-gap'] = gap + 'px';
  }
  if (rowGap) {
    style['--grid-colum-gap'] = rowGap + 'px';
  }
  if (columGap) {
    styles['--grid-colum-gap'] = columGap + 'px';
  }
  if (minWidth) {
    style['--grid-min'] = minWidth + 'px';
  }
  if (maxWidth) {
    style['--grid-max'] = maxWidth + 'px';
  }

  return (
    <div
      className={classNames(styles.wrap, className)}
      style={style}
      {...props}
    >
      {children}
    </div>
  );
};

export default Grid;
